package com.fenghongzhang.day008;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Color;
import android.os.Bundle;
import android.widget.Toast;

import com.ashokvarma.bottomnavigation.BottomNavigationBar;

public class MainActivity extends AppCompatActivity implements MyBottomNavigationBar.MyListener {
    private MyBottomNavigationBar bar;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
//        BottomNavigationBar bottomNavigationBar = new BottomNavigationBar();

        bar = (MyBottomNavigationBar) findViewById(R.id.bar);

        bar.setBackColor(Color.BLACK);

        bar.addItem(new MyBottomItem().setTitle("哈哈哈"))
                .addItem(new MyBottomItem().setTitle("哈哈哈"))
                .addItem(new MyBottomItem().setImage(getDrawable(R.mipmap.ic_launcher)))
                .addItem(new MyBottomItem().setTitle("哈哈哈"))
                .addItem(new MyBottomItem().setTitle("哈哈哈"))
                .Build();//赋值属性的.

        bar.setMyListener(this);

    }

    @Override
    public void click(int i) {
        Toast.makeText(this, ""+i, Toast.LENGTH_SHORT).show();
    }
}
